package com.njitt.bysj.config;

import com.jagregory.shiro.freemarker.ShiroTags;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * @description: shiro freemarker 配置类
 * @author: wyj
 * @time: 2022/3/19 18:02
 */
@Component
public class ShiroTagsFreeMarkerCfg {
    @Resource
    private FreeMarkerConfigurer freeMarkerConfigurer;

    @PostConstruct
    public void setShareVariable() {
      freeMarkerConfigurer.getConfiguration().setSharedVariable("shiro", new ShiroTags());
    }

}
